module.exports = {
  group(n) {
    return n < 10 ? ('0' + n) : n;
  },
  getYear(aDate) {
    return aDate.getFullYear();
  },
  getMonth(aDate) {
    let v = aDate.getMonth() + 1;
    return this.group(v);
  },
  getDate(aDate) {
    let v = aDate.getDate();
    return this.group(v);
  },
  getHours(aDate) {
    let v = aDate.getHours();
    return this.group(v);
  },
  getMinutes(aDate) {
    let v = aDate.getMinutes();
    return this.group(v);
  },
  getSeconds(aDate) {
    let v = aDate.getSeconds();
    return this.group(v);
  },
  getCpDate() {
    let aDate = new Date();
    let y = this.getYear(aDate);
    let m = this.getMonth(aDate);
    let d = this.getDate(aDate);
    let h = this.getHours(aDate);
    let min = this.getMinutes(aDate);
    let s = this.getSeconds(aDate);
    return y + '-' + m + '-' + d + ' ' + h + ':' + min + ':' + s;
  }
}